		<div class="weui-tabbar xinsu-tabbar">
		    <a href="/stock/bull" class="weui-tabbar__item <{if $common_info.action == 'bull'}>xinsu-current<{/if}>">
			    <div class="weui-tabbar__icon">
			        <i class="xinsu-icon-font xinsu-icon-deal"></i>
			    </div>
		      	<p class="weui-tabbar__label">交易</p>
		    </a>
		    <a href="/stock/index" class="weui-tabbar__item <{if $common_info.action != 'bull' && $common_info.controller == 'stock'}>xinsu-current<{/if}>">
			    <div class="weui-tabbar__icon">
			        <i class="xinsu-icon-font xinsu-icon-search"></i>
			    </div>
			    <p class="weui-tabbar__label">查询</p>
		    </a>
		    <a href="/user/asset" class="weui-tabbar__item <{if $common_info.action == 'asset' || $common_info.controller == 'atm'}>xinsu-current<{/if}>">
		      	<div class="weui-tabbar__icon">
		        	<i class="xinsu-icon-font xinsu-icon-asset"></i>
		      	</div>
		      	<p class="weui-tabbar__label">资产</p>
		    </a>
		    <a href="/" class="weui-tabbar__item <{if ($common_info.action != 'asset' && $common_info.controller == 'user') || $common_info.controller == 'index'}>xinsu-current<{/if}>">
		      	<div class="weui-tabbar__icon">
		        	<i class="xinsu-icon-font xinsu-icon-user"></i>
		      	</div>
		      	<p class="weui-tabbar__label">我的</p>
		    </a>
		</div>
	</body>
	<script>
		//底部导航隐藏
		var original = document.documentElement.clientHeight;
		window.addEventListener("resize", function() {
			var resizeHeight = document.documentElement.clientHeight;
			if(resizeHeight != original) {
				$('.xinsu-tabbar').hide()
			} else {
				$('.xinsu-tabbar').show()
			}
		});
		var token = "<{$token}>";
		//退出登录
		function logout() {
			layer.confirm('您确定要退出？', {icon: 3}, function () {
				stock = system_info = -1
				var url = "/user/logout";
				layer.closeAll();
				http_request_post(url, null, function(res) {
					layer.msg(res.msg, {time: 800}, function () {
						//跳转到登录页面
						location.href = "/user/login";
					});
				});
			});
		}
		
		//提交表单
        var sub = 0;
		$("form").submit(function () {
			//判断提交方式：get-搜索专用，post-保存专用
			var method = $(this).attr("method");
			if (method == "post") {
				//保存专用
				var rmsg = "";
				var data = $(this).serialize();
				if ("<{$common_info['action']}>" == "bull") {
					var msg = "您是否确定以上交易？";
					var bull_type = $("input[name='bull_type']:checked").val();
					var price_type = $("input[name='price_type']:checked").val();
					
					//股票类型
					if (bull_type == 1) {
						rmsg += "融资";
					} else {
						rmsg += "融券";
					}
					
					//交易类型
					if (price_type == 0) {
						rmsg += "市价";
					} else {
						rmsg += "限价";
					}
					rmsg += "委托处理成功！";
				} else {
					var msg = "您是否确执行该操作？";
				}
				data += '&token='+token;
				layer.confirm(msg, {icon: 3}, function () {
                    sub += 1;
					layer.closeAll();
                    if (sub == 1) {
                        http_request_post("", data, function (result) {
                            if (rmsg == "") {
                                layer.msg(result.msg, {time:800}, function (){
                                    if (result.data != "") {
                                        location.href = result.data;
                                    } else {
                                        location.reload();
                                    }
                                });
                            } else {
                                layer.alert(rmsg, {icon:1, closeBtn:0}, function(){
                                    if (result.data != "") {
                                        location.href = result.data;
                                    } else {
                                        location.reload();
                                    }
                                });
                            }
                        });
                    }
				});
				return false;
			} else {
				//搜索专用
				var data = $(this).serializeArray();
				var	url = "/<{$common_info.controller}>/<{$common_info.action}>";
				$.each(data, function(key, val) {
					if (val.value == "") {
						url += "/0";
					} else {
						url += "/" + val.value;
					}
				});
				location.href = url;
				return false;
			}
		})
		
		//通用post请求
		function http_request_post(url, data, callback) {
			if (url != "") {
				url = url;
			}
			$.ajax({
				type : 'post',  
				url : url,
				dataType : 'json',
				data : data,
				success : function(repones) {
					if (repones.status == 1) {
						if (typeof callback === "function") {
							callback(repones);
							return false;
						} else {
							layer.msg('请求加载数据失败，请重新加载');
						}
					} else if (repones.status == 2) {
						stock = system_info = -1
						layer.msg(repones.msg, {time:800}, function() {
							location.href = "/user/login";
						});
						return false;
					} else if (repones.status == 0) {
						token = repones.token;
						layer.msg(repones.msg);
						stock = system_info = -1
						return false;
					} else {
						layer.msg(repones.msg);
						stock = system_info = -1
						return false;
					}
				},
				error : function () {
					layer.load(1, {shade: [0.1,'#fff'], time:500}, function(){
						location.reload();
					});
					return false;
				}
			});
			return false;
		}
	</script>
</html>